li = [54, 26, 93, 17, 77, 31, 44, 55, 20]
def q_sort(li):
    if len(li) <= 1:
        return li
    l_li = []
    r_li = []
    for i in li[1:]:
        if li[0] > i:
            l_li.append(i)
        else:
            r_li.append(i)
    l_li = q_sort(l_li)
    r_li = q_sort(r_li)
    li = l_li + [li[0]] + r_li
    return li
print(q_sort(li))